import request from './request'

// 获取部门树
export function getDepartmentTree() {
  return request({
    url: '/department/tree',
    method: 'get'
  })
}

// 获取部门详情
export function getDepartmentById(id: number) {
  return request({
    url: `/department/${id}`,
    method: 'get'
  })
}

// 添加部门
export function addDepartment(data: any) {
  return request({
    url: '/department',
    method: 'post',
    data
  })
}

// 更新部门
export function updateDepartment(data: any) {
  return request({
    url: '/department',
    method: 'put',
    data
  })
}

// 删除部门
export function deleteDepartment(id: number) {
  return request({
    url: `/department/${id}`,
    method: 'delete'
  })
} 